package com.example.myanimator.evaluator;

import android.animation.TypeEvaluator;

/**
 * @author tgw
 * @date 2021/3/17
 * @describe
 */
public class CharEvaluator implements TypeEvaluator<Character> {


    @Override
    public Character evaluate(float fraction, Character startValue, Character endValue) {
        int startInt = (int)startValue;
        int endInt = (int)endValue;
        int currentInt  = (int) (startInt+fraction*(endValue-startValue));
        char charValue = (char) currentInt;
        return charValue;
    }
}
